﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BlockOS.Server
{
    public class ServerConfig
    {
        public string Name { get; private set; }
        public string Description { get; private set; }
        public int TickPerSecond { get; private set; }
        public TimeSpan TickInterval { get; private set; }
        public string LevelPath { get; private set; }

        public ServerConfig(string levelPath)
        {
            LevelPath = levelPath;
            Name = "BlockOS Server";
            Description = "A BlockOS Server";
            TickPerSecond = 20;
        }

        public ServerConfig WithName(string name)
        {
            Name = name;
            return this;
        }

        public ServerConfig WithDescription(string description)
        {
            Description = description;
            return this;
        }

        public ServerConfig WithTickPerSecond(int tickPerSecond)
        {
            TickPerSecond = tickPerSecond;
            TickInterval = TimeSpan.FromSeconds(1.0 / TickPerSecond);
            return this;
        }
    }
}
